package trivia;


import java.awt.Dimension;
import java.awt.Rectangle;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class NewGameFrame {

	private JFrame jNewGameFrame = null;
	private JPanel jNewGameContentPane = null;
	private JLabel jNameLabel = null;
	private JTextField jNameTextField = null;
	private JComboBox jDifficComboBox = null;
	private JLabel jLevelLabel = null;
	private JButton jOkButton = null;
	private JButton jCancelButton = null;

	public NewGameFrame () {
		jNewGameFrame = getJNewGameFrame();
	}
	
	/**
	 * This method initializes jNewGameFrame	
	 * 	
	 * @return javax.swing.JFrame	
	 */
	public JFrame getJNewGameFrame() {
		if (jNewGameFrame == null) {
			jNewGameFrame = new JFrame();
			jNewGameFrame.setSize(new Dimension(199, 197));
			jNewGameFrame.setTitle("New game");
			jNewGameFrame.setContentPane(getJNewGameContentPane());
			jNewGameFrame.setVisible(false);
		}
		return jNewGameFrame;
	}

	/**
	 * This method initializes jNewGameContentPane	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	public JPanel getJNewGameContentPane() {
		if (jNewGameContentPane == null) {
			jLevelLabel = new JLabel();
			jLevelLabel.setBounds(new Rectangle(12, 46, 60, 18));
			jLevelLabel.setText("Level:  ");
			jNameLabel = new JLabel();
			jNameLabel.setText("Name: ");
			jNameLabel.setBounds(new Rectangle(12, 15, 60, 16));
			jNewGameContentPane = new JPanel();
			jNewGameContentPane.setLayout(null);
			jNewGameContentPane.add(jNameLabel, null);
			jNewGameContentPane.add(getJNameTextField(), null);
			jNewGameContentPane.add(jLevelLabel, null);
			jNewGameContentPane.add(getJDifficComboBox(), null);
			jNewGameContentPane.add(jLevelLabel, null);
			jNewGameContentPane.add(getJOkButton(), null);
			jNewGameContentPane.add(getJCancelButton(), null);
		}
		return jNewGameContentPane;
	}

	/**
	 * This method initializes jNameTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	public JTextField getJNameTextField() {
		if (jNameTextField == null) {
			jNameTextField = new JTextField();
			jNameTextField.setText("<player name>");
			jNameTextField.setBounds(new Rectangle(58, 13, 107, 22));
		}
		return jNameTextField;
	}

	/**
	 * This method initializes jDifficComboBox	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	public JComboBox getJDifficComboBox() {
		if (jDifficComboBox == null) {
			jDifficComboBox = new JComboBox(new Object[]{"Easy", "Normal", "Hard"});
			jDifficComboBox.setBounds(new Rectangle(65, 42, 101, 24));
		}
		return jDifficComboBox;
	}

	/**
	 * This method initializes jOkButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	public JButton getJOkButton() {
		if (jOkButton == null) {
			jOkButton = new JButton();
			jOkButton.setBounds(new Rectangle(8, 120, 83, 29));
			jOkButton.setText("Ok");
		}
		return jOkButton;
	}

	/**
	 * This method initializes jCancelButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJCancelButton() {
		if (jCancelButton == null) {
			jCancelButton = new JButton();
			jCancelButton.setBounds(new Rectangle(102, 120, 83, 29));
			jCancelButton.setText("Cancel");
			jCancelButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					
					jNewGameFrame.setVisible(false);
				}
			});
		}
		return jCancelButton;
	}
}